# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Monitoring.V3.Model.Snooze do
  @moduledoc """
  A Snooze will prevent any alerts from being opened, and close any that are already open. The Snooze will work on alerts that match the criteria defined in the Snooze. The Snooze will be active from interval.start_time through interval.end_time.

  ## Attributes

  *   `criteria` (*type:* `GoogleApi.Monitoring.V3.Model.Criteria.t`, *default:* `nil`) - Required. This defines the criteria for applying the Snooze. See Criteria for more information.
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - Required. A display name for the Snooze. This can be, at most, 512 unicode characters.
  *   `interval` (*type:* `GoogleApi.Monitoring.V3.Model.TimeInterval.t`, *default:* `nil`) - Required. The Snooze will be active from interval.start_time through interval.end_time. interval.start_time cannot be in the past. There is a 15 second clock skew to account for the time it takes for a request to reach the API from the UI.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Required. Identifier. The name of the Snooze. The format is: projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] The ID of the Snooze will be generated by the system.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :criteria => GoogleApi.Monitoring.V3.Model.Criteria.t() | nil,
          :displayName => String.t() | nil,
          :interval => GoogleApi.Monitoring.V3.Model.TimeInterval.t() | nil,
          :name => String.t() | nil
        }

  field(:criteria, as: GoogleApi.Monitoring.V3.Model.Criteria)
  field(:displayName)
  field(:interval, as: GoogleApi.Monitoring.V3.Model.TimeInterval)
  field(:name)
end

defimpl Poison.Decoder, for: GoogleApi.Monitoring.V3.Model.Snooze do
  def decode(value, options) do
    GoogleApi.Monitoring.V3.Model.Snooze.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Monitoring.V3.Model.Snooze do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
